Logic Elements > Statements

Statements

Statements cause MedModel to take some action or perform some operation. Unlike functions, statements neither return a value nor use parentheses, and logic may contain comments. (See Comments.) Statements can use spacing (including a new line) before each word in a statement, and are case insensitive so any letter may be either upper or lower case.

General Action and Control Statements

General statements can be divided into two main categories: action and control statements. They are called general because they can be used in any logic. Action statements cause some action to occur in the model, such as changing an entity’s graphic or writing to a file. Control Statements determine the next statement to be executed, such as loops, branches, and statement blocks.

Resource- and Entity-Related Operation Statements

Operation Statements perform specific actions on entities and resources at locations throughout the system whenever they are encountered by an entity in the operation logic. They are valid only in certain areas. See each statement for a list of places where it is valid.

 

There are two subsets of operation statements: entity-related and resource-related. Entity-related operation statements perform specific actions on entities only. Resource-related operation statements involve resources alone (for example, GET and FREE) or resources and entities together (for example, USE).

Statement Blocks

A statement block is a group of statements that begin with the keyword BEGIN, or the symbol “{”, and end with the keyword END, or the symbol “}”. Two examples appear below. See BEGIN and END for more extensive examples of statement blocks.

Statement blocks

BEGIN {

Statement 1 Statement 1

Statement 2 Statement 2

Statement 3 Statement 3

... ...

Statement n Statement n

END }


© 2012 ProModel Corporation • 556 East Technology Avenue • Orem, UT 84097 • Support: 888-776-6633 • www.promodel.com